home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-1.iso / Files / Util / M / MacDOS 3.0.sit / MacDOS 3.0 ƒ / executables / MacDOS 3.0.rsrc / TEXT_176_SSTR.txt < prev    next >
Encoding:
Text File  |  1995-04-09  |  1.4 KB  |  34 lines

  1. Extracts substrings from variables.
  2.  
  3. SSTR var [delim] [/E] [/L | /R]
  4.  
  5.   var     is the name of the variable from which the substring is
  6.           to be extracted. SSTR replaces the content of 'var' with
  7.           the substring.
  8.   delim   is the string which delimits the substring. MacDOS searches
  9.           'var' and stops when it finds 'delim'. Depending on the
  10.           presence of switches, MacDOS extract from 'var' the
  11.           substring on the left or on the right of 'delim'. If 'delim'
  12.           is empty or missing or if 'delim' is not found within 'var',
  13.           'var' is left unchanged. An error condition occurs when 'var'
  14.           does not contain 'delim'.
  15.           Note that 'delim' must precede any switch if it begins with '/'.
  16.   /E      searches 'var' from the End (i.e. from right to left).
  17.           Without /E, SSTR searches 'var' from left to right.
  18.   /L      extracts the substring on the Left of 'delim' (this is the
  19.           default).
  20.   /R      extracts the substring on the Right of 'delim'.
  21.  
  22. /L and /R cannot be present simultaneously. Note that the searches
  23. are always case sensitive. Use TOUPPER to convert strings to upper
  24. case, so that searches can be made case insensitive.
  25.  
  26. Examples:
  27.   ! initially VAR contains: "a few chars and nothing more"
  28.   SSTR VAR "and nothing"
  29.   ! VAR now contains: "a few chars "
  30.   SSTR VAR /E " "
  31.   ! VAR now contains: "a few chars"
  32.   SSTR VAR w /R
  33.   ! VAR now contains: " chars"
  34.